package com.sansan.qiangji.controller.device;

import com.sansan.qiangji.realize.device.BeltParamDetailReal;
import com.sansan.qiangji.resultVO.ResultVO;
import com.sansan.qiangji.utils.ResultVOUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@CrossOrigin()
@RestController
@RequestMapping("/beltParamDetail")
@Slf4j
public class BeltParamDetailController {
    private BeltParamDetailReal beltParamDetailReal;

    @Resource
    public void setBeltParamDetailReal(BeltParamDetailReal beltParamDetailReal){
        this.beltParamDetailReal = beltParamDetailReal;
    }

    @PostMapping("/changeBeltParamDetailValue")
    public ResultVO<Object> changeBeltParamDetailValue(@RequestParam(name = "beltName") String beltName,
                                                          @RequestParam(name = "beltParamName") String beltParamName,
                                                          @RequestParam(name = "beltParamChangeValue") Long beltParamChangeValue) {
        beltParamDetailReal.changeBeltParamDetailValue(beltName, beltParamName, beltParamChangeValue);
        return ResultVOUtil.success(null);
    }
}
